package 测试;

import java.util.Scanner;

public class 迷雾 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		while (sc.hasNext()) {
			int n = sc.nextInt();
			String s = sc.next();
			System.out.println(func(n, s));
		}
		sc.close();
	}

	public static String func(int n, String s) {
		StringBuffer sb = new StringBuffer();
		int tmp = 0;
		for (int i = 0; i < s.length(); i++) {
			tmp = tmp * 10 + s.charAt(i) - '0';
			if (tmp <= n)
				continue;
			i--;
			sb.append(tmp / 10).append(" ");
			tmp = 0;
		}
		sb.append(tmp).append(" ");
		return sb.toString();
	}

}
